<?php

/**
 * citation actions.
 *
 * @package    Redsea20
 * @subpackage citation
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class citationActions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeIndex(sfWebRequest $request)
  {
            
    $str="";
      if ($this->getRequestParameter('search')!=null && $this->getRequestParameter('search')!="")
      {
          $str= explode("OLY", $this->getRequestParameter('search'))  ;

      }
            if ($str[0]!=null && $str[0]!="")
            {
                  $this->researchs=Doctrine_Query::create()
                  ->from('research r')
                  ->leftJoin('r.Observation o')
		  ->leftJoin('o.Observationdepth od')
                  ->leftJoin('od.Observationdepthdetail odd')
                  ->where('odd.id In ('.$str[0].')')
                  ->execute();
            }
            if ($str[1]!=null && $str[1]!="")
            {
                  $this->researchsoverlay=Doctrine_Query::create()
                  ->from('research r')
		  ->leftJoin('r.ResearchOverlay ro')
		  ->where('ro.id In ('.$str[1].')')
                  ->execute();
            }
            if ($str[2]!=null && $str[2]!="")
            {
                  $this->researchsnonbiological=Doctrine_Query::create()
                  ->from('research r')
                  ->leftJoin('r.Observation o')
                  ->leftJoin('o.Observationdepth od')
                  ->where('od.id In ('.$str[2].') ')
                  ->execute();
            }



            
            //echo count($this->researchsnonbiological);
            //return sfView::NONE;


            
            
            
  }
}
